package com.zjj.lbw.microservice.sentinel.app.demo;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.zjj.lbw.common.bean.R;

/**
 * @author zhanglei.zjj
 * @description 使用外部类配置-限流、降级处理
 * @date 2023/7/28 11:58
 */
public class ExceptionUtil {
    public static R fallback(Integer id, Throwable e) {
        return R.error(-1, "===被异常降级啦===");
    }

    public static R handleException(Integer id, BlockException e) {
        return R.error(-2, "===被限流啦===");
    }
}
